import fetch from 'utils/fetch';
// 屏保时间设置
export function getScreenSaverInfo(json) {
    const data = {...json};
    return fetch({
        url: 'wisdom/screensaver/getScreenSaverInfo',
        method: 'post',
        data
    });
}
// 智慧班牌班级评分详情 分页
export function pageClassScore(json) {
    const data = {...json};
    return fetch({
        url: 'newWisdom/pageClassScore/'+json.page+'/'+json.rows,
        method: 'post',
        data
    });
}
//添加评分项
export function saveScore(json) {
    const data = {...json};
    return fetch({
        url: `newWisdom/saveScore`,
        method: 'post',
        data
    });
}

//删除评分项
export function deleteClassScore(json) {
    const data = {...json};
    return fetch({
        url: `newWisdom/deleteClassScore`,
        method: 'post',
        data
    });
}
// listWisdomAttention
// 回填考试注意事项
export function listWisdomAttention(json) {
    const data = {...json};
    return fetch({
        url: 'newWisdom/exam/listWisdomAttention',
        method: 'post',
        data
    });
}
// 屏保设置的table
export function pageWisdomScreensaver(json) {
    const data = {...json};
    return fetch({
        url: 'wisdom/screensaver/pageWisdomScreensaver',
        method: 'post',
        data
    });
}
//新增/修改屏保
export function savePicture(json) {
    const data = {...json};
    return fetch({
        url: 'wisdom/screensaver/savePicture',
        method: 'post',
        data
    });
}
// 修改屏保

export function editPicture(json) {
    const data = {...json};
    return fetch({
        url: 'wisdom/screensaver/editPicture',
        method: 'post',
        data
    });
}
// 保存锁屏时间，屏保设置页面
export function updateWisdomScreensaverTime(json) {
    const data = {...json};
    return fetch({
        url: 'wisdom/screensaver/updateWisdomScreensaverTime',
        method: 'post',
        data
    });
}

// 删除
export function deletepicture(json) {
    const data = {...json};
    return fetch({
        url: 'wisdom/screensaver/deletepicture',
        method: 'post',
        data
    });
}
// 回填编辑屏保
export function getPicture(json) {
    const data = {...json};
    return fetch({
        url: 'wisdom/screensaver/getPicture',
        method: 'post',
        data
    });
}


// 家校通列表
export function pageContactPerson(json) {
    const data = {...json};
    return fetch({
        url: 'wisdom/contact/pageContactPerson',
        method: 'post',
        data
    });
}
// 倒计时内容
export function getCountdownLimitSix(json) {
    const data = {...json};
    return fetch({
        url: 'wisdom/countdown/getCountdownLimitSix',
        method: 'post',
        data
    });
}
// 添加倒计时
export function saveSchoolCountDown(json) {
    const data = {...json};
    return fetch({
        url: 'newCountDown/saveSchoolCountDown',
        method: 'post',
        data
    });
}
// 删除倒计时
export function deleteSchoolCountDown(json) {
    const data = {...json};
    return fetch({
        url: 'newCountDown/deleteSchoolCountDown',
        method: 'post',
        data
    });
}

// 班级风采/荣誉墙
export function classPageAreaPic(json) {
    const data = {...json};
    return fetch({
        url: 'newWisdom/pageAreaPic/'+json.page+'/'+json.rows,
        method: 'post',
        data
    });
}
// 修改上线状态
export function updatePicStatus(json) {
    const data = {...json};
    return fetch({
        url: 'newWisdom/updatePicStatus',
        method: 'post',
        data
    });
}
// 删除班级风采/荣誉墙列表
export function deletePic(json) {
    const data = {...json};
    return fetch({
        url: 'newWisdom/deletePic',
        method: 'post',
        data
    });
}
// 保存班级风采/荣誉墙
export function saveAreaPic(json) {
    const data = {...json};
    return fetch({
        url: 'newWisdom/saveAreaPic',
        method: 'post',
        data
    });
}
// 班级宣言查询
export function getCopyWrtier(json) {
    const data = {...json};
    return fetch({
        url: 'newWisdom/getCopyWrtier',
        method: 'post',
        data
    });
}
// 班级宣言列表查询
export function getCopyWrtierByGrade(json) {
    const data = {...json};
    return fetch({
        url: 'newWisdom/getCopyWrtierByGrade',
        method: 'post',
        data
    });
}
// 班级宣言保存
export function saveCopyWrtier(json) {
    const data = {...json};
    return fetch({
        url: 'newWisdom/saveCopyWrtier',
        method: 'post',
        data
    });
}




// 班级回填上一次的评分项
export function getSchoolScore(json) {
    const data = {...json};
    return fetch({
        url: 'newWisdom/getSchoolScore',
        method: 'post',
        data
    });
}






// 智慧班牌管理
// 班级值日

// 该班级下的学生

export function listStudentByClassId(fClassId ) {
    const data = {
        fClassId
    };
    return fetch({
        url: 'wisdom/classduty/listStudentByClassId',
        method: 'post',
        data
    });
}
// 获取该班级的值日表
export function getClassDuty(fSchoolId,fClassId ) {
    const data = {
        fSchoolId,
        fClassId
    };
    return fetch({
        url: 'wisdom/classduty/getClassDuty',
        method: 'post',
        data
    });
}
// 保存值日
export function saveClassDuty(
    fSchoolId,fClassId,sMonday,sTuesday,sWednesday,
    sThursday,sFriday,sSaturday,sSunday

) {
    const data = {
        fSchoolId,
        fClassId,
        sMonday,
        sTuesday,
        sWednesday,
        sThursday,
        sFriday,
        sSaturday,
        sSunday
    };
    return fetch({
        url: 'wisdom/classduty/saveClassDuty',
        method: 'post',
        data
    });
}
// 班级风采/荣誉墙显示
export function pageAreaPic(json) {
    const data = {
       ...json
    };
    return fetch({
        url: 'newWisdom/pageAreaPic/'+json.page+'/'+json.rows,
        method: 'post',
        data
    });
}

// // 保存图片视频
// export function saveAreaPic(fClassId, fSchoolId, sName,sType, sUrl) {
//     const data = {
//         fClassId, 
//         fSchoolId,
//         sName,//图片名称
//         sType, //0 是上传图片 1上传视频
//         sUrl
//     };
//     return fetch({
//         url: 'Wisdom/saveAreaPic',
//         method: 'post',
//         data
//     });
// }
// // 文案的查询
// export function getCopyWrtier(fClassId, fSchoolId) {
//     const data = {
//         fClassId, 
//         fSchoolId,
//     };
//     return fetch({
//         url: 'Wisdom/getCopyWrtier',
//         method: 'post',
//         data
//     });
// }
// // 文案展示的保存
// export function saveCopyWrtier(fClassId, fSchoolId, sTitle,sContent) {
//     const data = {
//         fClassId, 
//         fSchoolId,
//         sTitle,
//         sContent, 
//     };
//     return fetch({
//         url: 'Wisdom/saveCopyWrtier',
//         method: 'post',
//         data
//     });
// }

// 新增课程表
export function saveClassSchedule(fSchoolId, sType, sSchoolName, fClassId, sClassName, subjectNames) {
    const data = {
        fSchoolId, 
        sType, 
        sSchoolName, 
        fClassId, 
        sClassName, 
        subjectNames
    };
    return fetch({
        url: 'Wisdom/saveClassSchedule',
        method: 'post',
        data
    });
}
// 修改课程表
export function updateClassSchedule(pId,fSchoolId, sType, sSchoolName, fClassId, sClassName, subjectNames) {
    const data = {
        pId,
        fSchoolId,
        sType,
        sSchoolName,
        fClassId,
        sClassName,
        subjectNames
    };
    return fetch({
        url: 'Wisdom/updateClassSchedule',
        method: 'post',
        data
    });
}


// 获取课程表
export function getClassSchedule(fSchoolId, sSchoolName, fClassId, sClassName, subjectNames) {
    const data = {
        fSchoolId, 
        sSchoolName, 
        fClassId, 
        sClassName, 
        subjectNames
    };
    return fetch({
        url: 'Wisdom/getClassSchedule',
        method: 'post',
        data
    });
}


// /wisdom/exam/pageWisdomExam/1/10
export function pageWisdomExam(fSchoolId, sExamName, page, rows) {
    const data = {
        fSchoolId, 
        sExamName,
        page, 
        rows
    };
    return fetch({
        url: 'newWisdom/exam/pageWisdomExam/'+page+'/'+rows,
        method: 'post',
        data
    });
}

// 获取评分项表头s
export function getScoreHeader(json) {
    const data = {
        ...json
    };
    return fetch({
        url: 'newWisdom/getScoreHeader',
        method: 'post',
        data
    });
}
// 班级评分页分页表身
export function classPageScore(json) {
    const data = {
        ...json
    };
    return fetch({
        url: 'newWisdom/pageScore/'+json.page+'/'+json.rows,
        method: 'post',
        data
    });
}
// 编辑的表身
export function listScore(json) {
    const data = {
        ...json
    };
    return fetch({
        url: 'newWisdom/listScore',
        method: 'post',
        data
    });
}
// wisdom/exam/insertWisdomExam
// 插入
export function insertWisdomExam(fSchoolId, sExamName, sStartDate, sEndDate) {
    const data = {
        fSchoolId, 
        sExamName,
        sStartDate,
        sEndDate
    };
    return fetch({
        url: 'newWisdom/exam/insertWisdomExam',
        method: 'post',
        data
    });
}
    
// 获取评分项
export function pageScore(page,rows,fSchoolId, sort, gradeId, fClassId) {
    const data = {
        fSchoolId,
        sort,
        gradeId, 
        fClassId
    };
    return fetch({
        url: `Wisdom/pageScore/${page}/${rows}`,
        method: 'post',
        data
    });
}

// wisdom/exam/deleteWisdomExam
// 删除
export function deleteWisdomExam(pId) {
    const data = {
        pId
    };
    return fetch({
        url: 'newWisdom/exam/deleteWisdomExam',
        method: 'post',
        data
    });
}

// 获取班级评分
export function getRatingInfo(fSchoolId,fClassId) {
    const data = {
        fSchoolId,
        fClassId
    };
    return fetch({
        url: `Wisdom/getRatingInfo`,
        method: 'post',
        data
    });
}


// 查询考场科目
export function listWisdomExamsubject(pId, fExamId) {
    const data = {
        pId,
        fExamId
    };
    return fetch({
        url: 'newWisdom/exam/listWisdomExamsubject',
        method: 'post',
        data
    });
}

// 保存修改评分项
export function modifyRatingInfo(json) {
    const data = [...json]
    return fetch({
        url: `newWisdom/modifyRatingInfo`,
        method: 'post',
        data
    });
}
// 分页查询考场信息
// this.ruleForm.ExamName, this.ruleForm.ExamSub, this.listQuery.page, this.config.pageSize
export function pageWisdomExamroom(pId, fExamroomId, fClassId, page, rows) {
    const data = {
        pId,
        fExamroomId,
        fClassId,
        page,
        rows
    };
    return fetch({
        url: 'newWisdom/exam/pageWisdomExamroom/'+page+'/'+rows,
        method: 'post',
        data
    });
}

// //添加评分项
// export function modifyScore(sRatingName, sPosition, sScore, fSchoolId, sSchoolName) {
//     const data = {
//         sRatingName, 
//         sPosition, 
//         sScore, 
//         fSchoolId, 
//         sSchoolName
//     };
//     return fetch({
//         url: `Wisdom/modifyScore`,
//         method: 'post',
//         data
//     });
// }

export function listsubject(fSchoolId) {
    const data = {
        fSchoolId
    };
    return fetch({
        url: 'newWisdom/exam/listsubject',
        method: 'post',
        data
    });
}
    
//查询评分项
export function getSchoolRatingInfo(fSchoolId) {
    const data = {
        fSchoolId
    };
    return fetch({
        url: `Wisdom/getSchoolRatingInfo`,
        method: 'post',
        data
    });
}

// selectExamsubject
export function selectExamsubject(pId) {
    const data = {
        pId
    };
    return fetch({
        url: 'newWisdom/exam/selectExamsubject',
        method: 'post',
        data
    });
}




// 添加考场
export function updateWisdomExamroom(pId, listExamroom) {
    const data = {
        pId,
        listExamroom
    };
    return fetch({
        url: 'newWisdom/exam/updateWisdomExamroom',
        method: 'post',
        data
    });
}

// 添加考试科目
export function updateWisdomExamsubject(pId, listExamsubject) {
    const data = {
        pId,
        listExamsubject
    };
    return fetch({
        url: 'newWisdom/exam/updateWisdomExamsubject',
        method: 'post',
        data
    });
}
// 添加考试注意事项
export function updateWisdomAttention(pId, sAttentionMatter) {
    const data = {
        pId,
        sAttentionMatter
    };
    return fetch({
        url: 'newWisdom/exam/updateWisdomAttention',
        method: 'post',
        data
    });
}



// export function listWisdomExamroom(fExamId) {
//     const data = {
//         fExamId
//     };
//     return fetch({
//         url: 'wisdom/exam/listWisdomExamroom',
//         method: 'post',
//         data
//     });
// }

// 更新 查询考场信息
export function listWisdomroom(pId) {
    const data = {
        pId
    };
    return fetch({
        url: 'newWisdom/exam/listWisdomroom',
        method: 'post',
        data
    });
}

// 获取已选时间
export function listExamDate(fSchoolId) {
    const data = {
        fSchoolId
    };
    return fetch({
        url: 'wisdom/exam/listExamDate',
        method: 'post',
        data
    });
}

// updateWisdomExamroom
// export function updateWisdomExamroom(pId) {
//     const data = {
//         pId
//     };
//     return fetch({
//         url: 'wisdom/exam/updateWisdomExamroom',
//         method: 'post',
//         data
//     });
// }

//查看屏保
export function getWisdomScreensaver(fSchoolId) {
    const data = {
        fSchoolId
    };
    return fetch({
        url: 'wisdom/screensaver/getWisdomScreensaver',
        method: 'post',
        data
    });
}
//校验数据
export function verifyClassSchedule(filePath,fSchoolId, sSchoolName, fClassId, sClassName, sType) {
    const data = {
        filePath,
        fSchoolId,
        sSchoolName, 
        fClassId, 
        sClassName, 
        sType
    };
    return fetch({
        url: 'Wisdom/verifyClassSchedule ',
        method: 'post',
        data
    });
}
//导入保存课程表
export function importClassSchedule(fSchoolId, sSchoolName, fClassId, sClassName, sType, subjectNames) {
    const data = {
        fSchoolId,
        sSchoolName,
        fClassId,
        sClassName,
        sType,
        subjectNames
    };
    return fetch({
        url: 'Wisdom/importClassSchedule ',
        method: 'post',
        data
    });
}
//检查是否上传视频
export function getAreaVideo(fClassId, fSchoolId, sType) {
    const data = {
        fClassId,
        fSchoolId,
        sType, //0 是上传图片 1上传视频
    };
    return fetch({
        url: 'Wisdom/getAreaVideo',
        method: 'post',
        data
    });
}
//检查是否上传图片
export function getPicOnline(fClassId, fSchoolId, sType) {
    const data = {
        fClassId,
        fSchoolId,
        sType, //0 是上传图片 1上传视频
    };
    return fetch({
        url: 'Wisdom/getPicOnline',
        method: 'post',
        data
    });
}


